package controller;

import java.io.IOException;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;

public class Sender {
	OutputStream socketOS;
	private ByteBuffer bb;

	public Sender(OutputStream socketOS) throws IOException,
			InterruptedException {
		bb = ByteBuffer.allocate(2);
		bb.order(ByteOrder.LITTLE_ENDIAN);
		this.socketOS = socketOS;
	}
	
	public void send(byte light) throws IOException, InterruptedException {
		if(light == 1){
				socketOS.write(1);
				socketOS.flush();
				System.out.println("testing of hij verstuurd ");
		}else{
			socketOS.write(0);
			socketOS.flush();
		}
		light = 0;
	}
}
